<!-- <!DOCTYPE html> -->
<html lang="en">

<head>
	<meta charset="UTF-8">
	<!-- 使用UTF-8 -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport"
		content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<!-- 设置移动终端可视区域 -->
	<meta content="telephone=no" name="format-detection">
	<!-- 禁止iPhone等手机自动将数字变成可点击的拨号连接 -->
	<title>966588服务</title>
	<link href="css/style.css" type="text/css" rel="stylesheet" />
	<link href="css/weui.css" type="text/css" rel="stylesheet" />
</head>

<body style="background: #F6F6F6;">
	<div class="index" id="containerVue" v-cloak>
    <div v-show="showBanner==1" class="headerView">
      <i onclick="closeView()">&#139;</i>
      <h1>"966588"查询系统</h1>
      <div></div>
    </div>
    <div v-show="showBanner==0" style="background: #fff;" class="headerView">
      <i style="color:#0787d5" onclick="closeView()">&#139;<span style="color:#0787d5;font-size: 1rem;position: relative;bottom: 0.1rem;">返回</span></i>
    </div>
		<div style="height: 4rem;"></div>
		<div class="search" style="padding: .5rem 1rem 1.5rem ">
			<div style="font-size: .6rem;color: #999;position: absolute;left: 1rem;bottom: .25rem;">
				{{overPro.name}}（计划平均工期{{overPro.planAvaDay}}天,实际平均工期{{overPro.realAvaDay}}天）</div>
			<!-- <img src="image/logo.png" alt="" class="img"> -->
			<div class="input">
				<img src="image/search.png" alt="" class="icon">
				<form action="javascript:return true;">
					<input @keyup.enter="searchName" type="search" v-model="param.keyWord" placeholder="名称/委托单位/服务卡编号">
				</form>
				<span class="close" v-show="param.keyWord" @click="clearSearch">&#10006;</span>
			</div>
			<!-- <img src="image/more.png" alt="" class="more" @click="moreSel"> -->
			<!-- 筛选条件 -->
			<div class="choice_tip" v-if="choice">
				<div class="choice_view">
					<div class="choice">
						<div class="name">任务调整类型</div>
						<div class="text" @click="adjustOpen"><input type="text" readonly v-model="adjustType" /></div>
						<!-- 投诉原因选择 -->
						<div class="selectView" v-if="proType">
							<div class="ulView">
								<div class="title">任务调整类型</div>
								<div class="ul" style="height: 8.25rem;">
									<div class="li" v-for="item in adjust"
										:class="[item.value == param.adjustType?'active':'']"
										@click="causeSelect(item)">
										<div>{{item.title}}</div>
										<img src="./image/select.png" alt="">
										<img src="./image/selected.png" class="check" alt="">
									</div>
								</div>
								<div class="selectbtn">
									<!-- <div @click="causeBoole = false">取消</div> -->
									<div @click="selectCause" style="color: #2e84db;">确定</div>
								</div>
							</div>
						</div>
					</div>
					<div class="choice">
						<div class="name">项目完成情况</div>
						<div class="text">
							<div class="select">
								<input type="radio" name="radio1" value="0"
									v-model="param.isCompleted"><span>未完成</span>&nbsp;&nbsp;&nbsp;
								<input type="radio" name="radio1" value="1" v-model="param.isCompleted"><span>已完成</span>
							</div>
						</div>
					</div>
					<div class="choice_btn">
						<div class="btn_view" @click="choice = false">关闭</div>
						<div class="btn_view choice_btn_active" @click="searchName()">确定</div>
					</div>
				</div>
			</div>
		</div>
		<div class="cont">
			<div>
				<div class="list">
					<!-- <div class="title">{{items.contractName}}</div> -->
					<div class="ul">
						<div v-if="info.length!=0">
							<div class="li" v-for="item in info">
								<div class="h1" @click="listDetail(item)">
                  <div v-if="(!item.isDelay||item.isDelay=='')&&item.isFinish==''">
                    <div class="state state0" v-if="item.operateStatus == 0"><img
                      src="image/selected.png" alt="">正常</div>
                    <div class="state state1" v-if="item.operateStatus == 1"><img
                      src="image/icons_bg.png" alt="">变更</div>
                    <div class="state state2" v-else-if="item.operateStatus == 2"><img
                      src="image/icons_qx.png" alt="">取消
                    </div>
                    <div class="state state3" v-else-if="item.operateStatus == 3"><img
                      src="image/icons_zt.png" alt="">暂停
                    </div>
                    <div class="state state4" v-else-if="item.operateStatus == 4"><img
                      src="image/icons_cq.png" alt="">重启
                    </div>
                  </div>
                  <div v-if="(item.isDelay||item.isDelay=='1')&&item.isFinish==''">
                    <div class="state state2"><img src="image/icons_qx.png" alt="">超期
                    </div>
                  </div>
                  <div v-if="item.isFinish=='1'">
                    <div class="state state0"><img src="image/selected.png" alt="">完成</div>
                  </div>
									<span style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
										{{item.name}}
									</span>
								</div>
								<div class="liView">
									<div class="h6">
										<div class="h6Cont" v-if="item.code"><img src="image/icons_ID.png">{{item.code}}
										</div>
										<div class="h6Cont" v-if="item.busUserName"><img
												src="image/icons_person.png">{{item.busUserName}}
										</div>
									</div>
									<div class="h6">
										<div class="h6Cont" v-if="item.wtdw"><img
												src="image/icons_work.png">{{item.wtdw}}</div>
										<div class="h6Cont" v-if="item.leaderName"><img src="image/icons_pjr.png">{{item.leaderName}}</div>
									</div>
									<div class="h6">
										<div class="h6Cont" v-if="item.currentNodeTime"><img src="image/icons_pjsj.png">当前节点进入日期 : {{item.currentNodeTime}}</div>
										<div class="h6Cont"></div>
									</div>
								</div>
								<div class="speedView">
									<!-- <div class="h3">当前进度</div> -->
									<div class="speed" v-if="roleCode == 'ProjectAdmin'||roleCode == 'TeamLeader'">
										<div class="sel" :class="[item.projectNode < 0?'':'active']">
											<span class="circle1"><span class="circle2"><span class="circle3">1</span></span></span>
											<div>资料准备和外业生产</div>
										</div>
										<div class="sel" @click="changeProjectNode('1',item)" :class="[item.projectNode < 1?'':'active']">
											<i>&#8594;</i>
											<span class="circle1"><span class="circle2"><span class="circle3">2</span></span></span>
											<div>内业生产</div>
										</div>
										<div class="sel" @click="changeProjectNode('2',item)" :class="[item.projectNode < 2?'':'active']">
											<i>&#8594;</i>
											<span class="circle1"><span class="circle2"><span class="circle3">3</span></span></span>
											<div>成果质检</div>
										</div>
										<div class="sel" :class="[item.projectNode < 3?'':'active']">
											<i>&#8594;</i>
											<span class="circle1"><span class="circle2"><span class="circle3">4</span></span></span>
											<div>领取报告</div>
										</div>
									</div>
									<div class="speed" v-else>
										<div class="sel" :class="[item.projectNode < 0?'':'active']">
											<span class="circle1"><span class="circle2"><span
														class="circle3">1</span></span></span>
											<div>资料准备和外业生产</div>
										</div>
										<div class="sel" :class="[item.projectNode < 1?'':'active']">
											<i>&#8594;</i>
											<span class="circle1"><span class="circle2"><span
														class="circle3">2</span></span></span>
											<div>内业生产</div>
										</div>
										<div class="sel" :class="[item.projectNode < 2?'':'active']">
											<i>&#8594;</i>
											<span class="circle1"><span class="circle2"><span
														class="circle3">3</span></span></span>
											<div>成果质检</div>
										</div>
										<div class="sel" :class="[item.projectNode < 3?'':'active']">
											<i>&#8594;</i>
											<span class="circle1"><span class="circle2"><span
														class="circle3">4</span></span></span>
											<div>领取报告</div>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="li liText" style="margin-top: 8rem;" v-else><img src="image/kong.png" alt=""
								class="kong">暂无相关项目
						</div>
					</div>
				</div>
				<div class="js_dialog" style="opacity: 1;" v-if="isChangeNode">
					<div class="weui-mask"></div>
					<div class="weui-dialog" style="max-width: 20rem;">
						<div class="close" @click="isChangeNode = false" style="width: .8rem;height: .8rem;position: absolute;right: .8rem;top: .75rem"><img src="image/close.png" alt=""></div>
						<div class="weui-dialog__hd"><strong class="weui-dialog__title">提示</strong></div>
						<div class="weui-dialog__bd">
							是否修改{{changeNodeDes.proName}}的项目节点为{{changeNodeDes.nodeDes}}？
						</div>
						<div class="weui-dialog__ft">
							<div class="change-btn" @click="submitChangeNode" style="width: 50%">确定</div>
							<div class="change-btn" @click="isChangeNode = false" style="width: 50%">取消</div>
						</div>
					</div>
				</div>
			</div>
			<!-- <div class="li liText" style="margin-top: 8rem;" v-else><img src="image/kong.png" alt="" class="kong">暂无相关合同</div> -->
		</div>

		<!-- loading 加载 -->
		<div style="opacity: 1;" v-if="loading">
			<div class="weui-mask_transparent"></div>
			<div class="weui-toast">
				<img src="image/load.gif" alt="" style="width: 2rem;margin: 2rem auto .5rem;">
				<p class="weui-toast__content">加载中</p>
			</div>
		</div>
		<!-- 处理状态切换 -->
		<!-- <div v-if="roleCode == 'ProjectAdmin'||roleCode == 'DepartLeaderRole'">
			<div style="height: 3rem;"></div>
			<div class="footerview">
				<div class="nav">
					<div :class="param.isDealed == '-1'?'active':''" @click="handleClick(-1)">全部</div>
				</div>
				<div class="nav">
					<div :class="param.isDealed == '0'?'active':''" @click="handleClick(0)">待处理</div>
				</div>
				<div class="nav">
					<div :class="param.isDealed == '1'?'active':''" @click="handleClick(1)">已处理</div>
				</div>
			</div>
		</div> -->
		<!-- 统计数量 -->
		<!-- <div class="statisticsBtn" @click="goStatistics">
			<img src="image/tongji.png" alt="" />
		</div> -->
	</div>
	<script src="script/jquery-3.5.js"></script>
	<script src="script/vue.js"></script>
	<script src="script/api.js"></script>
	<script src="script/ajax.js"></script>
	<!-- <script src="../js/common/mui.min.js"></script> -->
	<!-- <script src="../js/common/openview.js"></script> -->
	<script>
		var app = new Vue({
			el: '#containerVue',
			data: {
				param: {
					adjustType: '',
					isCompleted: '0',
					deptCode: '',
					contractId: '',
					isDealed: '-1',
					keyWord: '',
					pageNo: 1,
					pageSize: 10,
          deptName: "",
					startDate: "",
					endDate: "",
          nature: "",
          overDateType: "",
          type: "",
				}, // 搜索条件
				info: [], // 首页列表
				tipBoole: false,
				isEnd: false,
				isAjax: false,
				loading: false,
				adjust: [], // 任务调整列表
				adjustIndex: "",
				proId: "",
				description: "",
				roleCode: "", // 角色类型
				scanInfo: null, // 扫描信息
				deptCode: null, // 扫描信息
				statistics: false, // 统计层
				statisticsInfo: {}, // 统计信息
				firstLink: localStorage.getItem("firstLink"),

				choice: false, // 筛选条件
				proType: false, // 筛选任务调整
				adjust: [],
				adjustType: '',
				isChangeNode:false,
				changeNodeDes:{},
        		showBanner:0,

				overPro: {
					name: "",
					realAvaDay: "",
					planAvaDay: ""
				}
			},
			created() {
				if (this.GetQueryString("deptName") == null || this.GetQueryString("startDate") == null || this
					.GetQueryString("endDate") == null|| this.GetQueryString("nature") == null || this.GetQueryString("overDateType") == null|| this.GetQueryString("type") == null) {
					this.param.deptName = "";
				} else {
					this.param.deptCode = decodeURI(decodeURI(this.GetQueryString("deptName")));
					this.param.deptName = decodeURI(decodeURI(this.GetQueryString("deptName")));
					this.param.startDate = this.GetQueryString("startDate");
					this.param.endDate = this.GetQueryString("endDate");
          this.param.nature = decodeURI(decodeURI(this.GetQueryString("nature")));
					this.param.overDateType = this.GetQueryString("overDateType");
          this.param.type = this.GetQueryString("type");
				}

				//过往超期下转的参数
        if(this.GetQueryString("currentMonth")){
          this.param.deptCodeArr=this.GetQueryString("deptCodeArr");
          this.param.currentMonth=this.GetQueryString("currentMonth");
          this.param.nature = decodeURI(decodeURI(this.GetQueryString("nature")));

          this.overPro.name =this.GetQueryString("currentMonth");
          this.overPro.planAvaDay =this.GetQueryString("plan");
          this.overPro.realAvaDay =this.GetQueryString("real");
        }else{
          this.getDays();
        }
				this.getList(true);
        this.getRole();
			},
			watch: {

			},
			methods: {
				changeProjectNode(currentNode,curProject){
					var nodeDes="";
					switch (currentNode) {
						case "1":nodeDes="内业生产";break;
						case "2":nodeDes="成果质检";break;
					}
					this.isChangeNode=true;
					this.changeNodeDes.currentNode=currentNode
					this.changeNodeDes.id=curProject.id
					this.changeNodeDes.proName=curProject.name
					this.changeNodeDes.nodeDes=nodeDes
				},
				submitChangeNode(){
					var that = this;
					let params={};
					params.currentNode=that.changeNodeDes.currentNode;
					params.projectid=that.changeNodeDes.id;
					ajaxHttp({
						url: 'jeecg-boot/node/nodeProjectInfo/changeProjectNode',
						type: 'post',
						data: params,
						success: function (res) {
							if (res.success) {
								$.Jsuccess(res.message)
								window.location.reload();
								that.isChangeNode=false
							} else {
								$.Jwarning(res.message)
								that.isChangeNode=false
							}
						}
					});
				},
				GetQueryString(name) {
					var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
					var r = window.location.search.substr(1).match(reg);
					if (r != null) return unescape(r[2]);
					return null;
				},
				getDays() {
					var that = this;
					ajaxHttp({
						url: 'jeecg-boot/node/nodeProjectInfo/getTotalPlanDayAndRealDayByDept',
						type: 'post',
						data: this.param,
						success: function (res) {
							if (res.success) {
								that.overPro.name = sessionStorage.getItem('deptName') != '全院项目总数' ?
									sessionStorage.getItem('deptName') : '全院';
								console.log(sessionStorage.getItem('deptName'),res.result);
								that.overPro.realAvaDay = res.result.realAvaDay.toFixed(2);
								that.overPro.planAvaDay = res.result.planAvaDay.toFixed(2);
							} else {
								$.Jwarning(res.message)
							}
						}
					});
				},
				// 更多筛选条件
				moreSel() {
					this.choice = true;
					this.param.adjustType = '';
					this.adjustType = "";
					this.getadjust()
				},
				// 重置任务调整
				resetCause() {
					this.param.adjustType = '';
				},
				// 筛选任务调整
				selectCause() {
					this.proType = false;
					if (this.param.adjustType == 1) {
						this.adjustType = "任务变更"
					} else if (this.param.adjustType == 2) {
						this.adjustType = "任务取消"
					} else if (this.param.adjustType == 3) {
						this.adjustType = "任务暂停"
					} else if (this.param.adjustType == 4) {
						this.adjustType = "任务重启"
					}
				},
				// 选择任务调整
				causeSelect(e) {
					console.log(JSON.stringify());
					this.param.adjustType = e.value;
				},
				adjustOpen() {
					this.proType = true;
				},
				// 获取投诉原因
				getadjust() {
					var that = this;
					ajaxHttp({
						url: 'jeecg-boot/sys/dict/getDictItems/DutyChange',
						type: 'get',
						data: {},
						success: function (res) {
							if (res.success) {
								that.adjustSel = res.result
							} else {
								$.Jwarning(res.message)
							}
						}
					});
				},
				// 跳转统计页面
				goStatistics() {
					window.location.href = 'statistics.html';
				},
				// 任务调整总数查看
				taskAll() {
					window.location.href = 'taskAllList.html';
				},
				// 评价总数查看
				compAll() {
					window.location.href = 'complaintAllList.html';
				},
				// 评价总数查看
				evalAll() {
					window.location.href = 'evalAllList.html';
				},
				// 关闭统计层
				statisticsClose() {
					this.statistics = false;
				},
				// 获取统计信息
				getStatistics() {
          this.showBanner=localStorage.getItem("showBanner");
					var that = this;
					ajaxHttp({
						url: 'jeecg-boot/node/nodeContract/getAllTotalInfos',
						type: 'post',
						data: {},
						beforeSend: function () {
							that.loading = true
						},
						success: function (res) {
							if (res.success) {
								// console.log(JSON.stringify(res));
								that.statisticsInfo = res.result
							} else {
								$.Jwarning(res.message)
							}
						},
						complete: function () {
							that.loading = false
						}
					});
				},
				// 扫一扫功能
				scan() {
					window.location.href = 'barcode.html';
				},
				// 处理状态
				handleClick(i) {
					this.param.isDealed = i;
					this.param.pageNo = 1;
					this.statistics = false;
					this.isEnd = false;
					this.getList(true);
				},
				// 列表详情页
				listDetail(item) {
					window.location.href = "index_detail.html";
					sessionStorage.setItem('projectId', JSON.stringify(item.id));
				},
				// 任务调整弹出层
				taskClick(e) {
					this.tipBoole = true;
					this.proId = e.id;
					this.adjustIndex = "";
					this.description = "";
				},
				// 任务调整状态更改
				adjustClick(i) {
					this.adjustIndex = i;
				},

				// 清楚搜索条件
				clearSearch() {
					this.param.keyWord = "";
				},
				// 手机端search回调
				searchName(e) {
					console.log(JSON.stringify(this.param));
					this.param.pageNo = 1;
					document.body.scrollTop = 0;
					this.isEnd = false;
					this.getList(true);
					this.choice = false;
				},

				// 获取首页列表
				getList(selet_type) {
          this.showBanner=localStorage.getItem("showBanner");
					let that = this;
					if (that.isEnd || that.isAjax) {
						return;
					}
					that.isAjax = true;
					ajaxHttp({
						url: 'jeecg-boot/node/nodeProjectInfo/getOverdateCountList',
						type: 'post',
						data: that.param,
						beforeSend: function () {
							that.loading = true
						},
						success: function (res) {
							// console.log(JSON.stringify(res));
							that.isAjax = false;
							if (res.success) {
								if (selet_type) {
									that.info = res.result.records;
								} else {
									that.info = that.info.concat(res.result.records);
								}
								that.isEnd = res.result.pages == that.param.pageNo;
								++that.param.pageNo;
							} else {
								$.Jwarning(res.message)
							}
						},
						error: function (err) {
							console.log(JSON.stringify(err));
						},
						complete: function () {
							that.loading = false
						}
					})
				},
				// 获取角色
				getRole() {
					let that = this;
					ajaxHttp({
						url: 'jeecg-boot/sys/role/queryRoleByUser',
						type: 'post',
						data: {},
						success: function (res) {
							// console.log(JSON.stringify(res));
							if (res.success) {
								res.result.forEach(item => {
									if (item.roleCode == "ProjectAdmin") { // 经营人员
										that.roleCode = item.roleCode;
										that.getList(true);
									} else if (item.roleCode == "ProjectNodeViewRole") { // 业主
										that.roleCode = item.roleCode;
									} else if (item.roleCode == "LeaderRole") { // 领导
										that.roleCode = item.roleCode;
										that.getList(true);
									} else if (item.roleCode == "DepartLeaderRole") { // 部门领导
										that.roleCode = item.roleCode;
										that.getList(true);
									} else if (item.roleCode == "TeamLeader") { // 大组长
										that.roleCode = item.roleCode;
										that.getList(true);
									}
								})
							} else {
								$.Jwarning(res.message)
							}
						},
						error: function (xhr, state, errorThrown) {
							console.log(JSON.stringify(xhr));
							console.log(JSON.stringify(state));
							console.log(JSON.stringify(errorThrown));
						}
					})
				},
				// 提交任务状态
				submit() {
					let that = this;
					if (that.adjustIndex == "") {
						$.Jwarning('请选择任务状态')
					} else {
						ajaxHttp({
							url: 'jeecg-boot/node/nodeProjectInfo/editOperateStatusByProId',
							type: 'post',
							data: {
								"operateStatus": that.adjustIndex,
								"proId": that.proId,
								"description": that.description
							},
							success: function (res) {
								// console.log(JSON.stringify(res));
								if (res.success) {
									$.Jsuccess('提交成功')
									setTimeout(function () {
										that.tipBoole = false;
										that.getList(true);
									}, 3000)
								} else {
									$.Jwarning(res.message);
								}
							}
						})
					}
				}
			}
		})
		// 上拉触底事件
		var screenHeight = window.screen.height;
		window.onscroll = function () {
			// 上拉加载更多
			if (screenHeight + document.body.scrollTop >= document.body.scrollHeight - 50) {
				app.getList(false);
			}
			// // 下拉刷新
			// if (document.body.scrollTop == 0) {
			// 	app.param.pageNo = 1;
			// 	app.getList(true);
			// }
		}
		var isPageHide = false;
		window.addEventListener('pageshow', function () {
			console.log('11111');
			if (isPageHide) {
				console.log('2222222');
				window.location.reload();
			}
		});

		window.addEventListener('pagehide', function () {
			isPageHide = true;
		});
	</script>
</body>

</html>